# 函数的定义
def text(a, b):  # a,b是形参
    c = a + b
    return c


result = text(12, 13) # 12,13是实参
print(result)

# 函数的参数传递
text(b=10,a=20)  #关键字传递  写了的话就会根据写的名称进行传递

def fun(arg1,arg2):
    print(arg1)
    print(arg2)
    arg1=100
    arg2=range(10)
    print(arg1)
    print(arg2)

n1=11
n2=[22,33,44]
fun(n1,n2)
print(n1,n2)

#函数的返回值   当函数返回多个值的时候，结果为元组
def fun1(num):
    odd=[]
    even=[]
    for i in num:
        if i % 2 == 0:
            odd.append(i)
        else:
            even.append(i)
    return odd,even

list1=[10,29,34,22,45,67,95]
print(fun1(list1))
















